Text Folding
-
Adam Williams
In case it's not obvious, the problem, I believe, is that the \n's at the beginning of those lines should have a space in front of them.
-
Rick DeNatale
- Assigned user set to Rick DeNatale
Adam,
I'm having trouble reproducing this. I added the following to the event_spec
context ".export" do
# .. unrelated snippage before(:each) do cal = RiCal.Calendar @it = RiCal::Component::Event.new(cal) end # More unrelated snippage ... it "should properly fold on export" do @it.description = "Weather report looks nice, 80 degrees and partly cloudy, so following Michael's suggestion, let's meet at the food court at Crossroads:\n\nhttp://www.shopcrossroadsplaza.c...\n" export_string = @it.export rputs ("***********") rputs export_string rputs ("***********") export_string.should match(%r(^DESCRIPTION:Weather report looks nice\\, 80 degrees and partly cloudy\\, so$)) export_string.should match(%r(^ following Michael's suggestion\\, let's meet at the food court at Crossr$)) export_string.should match(%r(^ oads:\\n\\nhttp://www.shopcrossroadsplaza\.c\.\.\.\\n)) endend
This passes, and the rputs dump this:
BEGIN:VCALENDAR
PRODID;X-RICAL-TZSOURCE=TZINFO:-//com.denhaven2/NONSGML ri_cal gem//EN
CALSCALE:GREGORIAN
VERSION:2.0
BEGIN:VEVENT
DESCRIPTION:Weather report looks nice\, 80 degrees and partly cloudy\, so
following Michael's suggestion\, let's meet at the food court at Crossr oads:\n\nhttp://www.shopcrossroadsplaza.c...\n END:VEVENT
END:VCALENDAR
Can you provide more info on this?
-
Adam Williams
That 'rputs dump' is hard to read on the website showing the ticket, but if it's like the email shows, the problem is that even in that dump, the Ruby String contains "at Crossr\noads:\n\nhttp". Notice that after Crossr, there is an unescaped carriage return, followed immediately by the oads characters. Isn't there supposed to be a space at the beginning of every folded line?
-
Rick DeNatale
Here's the actual example:
it "should properly fold on export" do @it.description = "Weather report looks nice, 80 degrees and partly cloudy, so following Michael's suggestion, let's meet at the food court at Crossroads:\n\nhttp://www.shopcrossroadsplaza.c...\n" export_string = @it.export export_string.should match(%r(^DESCRIPTION:Weather report looks nice\\, 80 degrees and partly cloudy\\, so$)) export_string.should match(%r(^ following Michael's suggestion\\, let's meet at the food court at Crossr$)) export_string.should match(%r(^ oads:\\n\\nhttp://www.shopcrossroadsplaza\.c\.\.\.\\n$)) endIf that doesn't format, then it's in event_spec.rb in the latest push to github, except for the $ in the last regexp, which I just notice was missing and added, but it still passes.
Notice that I'm checking for an extra space after each line break. And I've attached a file which I wrote from the export which shows things look OK.
So there must be something else going on with your specific use case.
-
Adam Williams
I think I found the problem.
it "should sanitize new lines" do @it.description = "Come and join us as we hear Andy Stanley take us deeper into how the accuser works in our lives..And how twisted our world is..\r\nYou will not want to miss these next two sessions." export_string = @it.export export_string.should match(%r(^DESCRIPTION:Come and join us as we hear Andy Stanley take us deeper into $)) export_string.should match(%r(^ how the accuser works in our lives..And how twisted our world is..\\nYou$)) export_string.should match(%r(^ will not want to miss these next two sessions.$)) endThe editor that is producing the content appears to be place "\r\n" in there. So, is it my responsibility to normalize new lines? If you run that, you will see that it is escaping the "\n" part of that "\r\n", but leaving the "\r".
I have attached an image of how Outlook is choking on the output.
DESCRIPTION:Come and join us as we hear Andy Stanley take us deeper into how the accuser works in our lives..And how twisted our world is.. \nYou will not want to miss these next two sessions. -
Rick DeNatale
I'm not sure.
The spec says that an intentional line break should be escaped by \n or \N, but I'm unclear what is meant here by an intentional line break.
I guess I could convert any of
\n \r\n \r \n\rinto "\n" but I'm not sure that that's the right answer. I've asked calsify list for a recommendation, but they haven't been very responsive.
-
Rick DeNatale
- State changed from new to open
I got one reply from the icalsify list, which indicated that I should treat any combination of /n /r as an "intentional" linebreak
-
Rick DeNatale
- State changed from open to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

